package com.umbacos.udm.client.view;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FileUpload;
import com.google.gwt.user.client.ui.FormPanel;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.umbacos.udm.client.arch.HourGlass;
import com.umbacos.udm.client.arch.ModalDialogBox;
import com.umbacos.udm.client.model.AsyncComm;

public class UploadPopupView extends ModalDialogBox {


	public final FormPanel form = new FormPanel();
	public final HourGlass hourglass=new HourGlass(null);
	public Button btSubmit= new Button("Upload");
	public Button btCancel= new Button("Cancel");
	public FileUpload upload = new FileUpload();
	
	public UploadPopupView(){

		setText("Choose the file to upload:");
		form.setAction(AsyncComm.getBaseUrl() + "cgi-bin/udm-2388.cgi");
		form.setEncoding(FormPanel.ENCODING_MULTIPART);
		form.setMethod(FormPanel.METHOD_POST);

		VerticalPanel panel = new VerticalPanel();
		form.setWidget(panel);

		upload.setName("uppo");
		upload.setName("go_upl");

		HorizontalPanel hpButtons=new HorizontalPanel();
		hpButtons.add(btCancel);
		hpButtons.add(btSubmit);
		
		panel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
		panel.setSpacing(10);
		panel.add(upload);
		panel.add(hpButtons);
		add(form);
	}

}
